﻿using QzgfFrame.Controllers.System.DepartmentManger;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using Spring.Testing.Microsoft;

namespace QzgfFrame.Mvc3.Tests
{
    
    
    /// <summary>
    ///这是 DepartmentControllerTest 的测试类，旨在
    ///包含所有 DepartmentControllerTest 单元测试
    ///</summary>
    [TestClass()]
    public class DepartmentControllerTest : AbstractDependencyInjectionSpringContextTests
    {
        public DepartmentController departmentController { set; get; }

        #region 附加测试特性
        // 
        //编写测试时，还可使用以下特性:
        //
        //使用 ClassInitialize 在运行类中的第一个测试前先运行代码
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //使用 ClassCleanup 在运行完类中的所有测试后再运行代码
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //使用 TestInitialize 在运行每个测试前先运行代码
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //使用 TestCleanup 在运行完每个测试后运行代码
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///GridPager 的测试
        ///</summary>
        [TestMethod()]
        public void GridPagerTest()
        {
            int page = 1; // TODO: 初始化为适当的值
            int pagesize = 10; // TODO: 初始化为适当的值
            string sortname = "id"; // TODO: 初始化为适当的值
            string sortorder = "desc"; // TODO: 初始化为适当的值
            string gridviewname = string.Empty; // TODO: 初始化为适当的值
            string gridsearch = string.Empty; // TODO: 初始化为适当的值
            string expected = "{\"Rows\":[],\"Total\":\"0\"}"; // TODO: 初始化为适当的值
            string actual;
            actual = departmentController.GridPager(page, pagesize, sortname, sortorder, gridviewname, gridsearch);
            Assert.AreEqual(expected, actual);
        }

        protected override string[] ConfigLocations
        {
            get
            {
                return new String[] { "assembly://QzgfFrame.Mvc3/QzgfFrame.Mvc3.Config/application.xml",
                "assembly://QzgfFrame.Mvc3/QzgfFrame.Mvc3.Config/application-respository.xml",
                "assembly://QzgfFrame.Mvc3/QzgfFrame.Mvc3.Config/application-domian.xml",
                "assembly://QzgfFrame.Mvc3/QzgfFrame.Mvc3.Config/application-control.xml"
                //,"assembly://QzgfFrame.Mvc3.Tests/QzgfFrame.Mvc3.Tests/app_testcontent.xml"
                // "assembly://QzgfFrame.Mvc3/QzgfFrame.Mvc3.Config/application-aop.xml",
                // "assembly://QzgfFrame.Mvc3/QzgfFrame.Mvc3.Config/application-ws.xml"
                };
                //return new String[] { "assembly://QzgfFrame.Mvc3/QzgfFrame.Mvc3/Web.config" };
                // return new String[] { "assembly://QzgfFrame.Mvc3/QzgfFrame.Mvc3.Config/application.xml" };
            }
        }
    }
}
